<template>
		<view class="_field_btn " :class="{
			'active': active
		}" @click="search">
			<view class="_name ">
				{{ name }}
			</view>
		</view>
</template>
<script setup>
	import {
		defineProps
	} from 'vue';
	const emit = defineEmits(['search'])

	const props = defineProps({
		name: String,
		active: {
			type: Boolean,
			default: false
		}
	})

	function search() {
		emit('search')
	}
</script>

<style lang="scss" scoped>
	._field_btn {
		border-radius: 54rpx;
		height: 54rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 0 20rpx;
		background-color: transparent;
		margin-right: 12rpx;
		._name {
			width: max-content;
			height: 40rpx;
			font-size: 28rpx;
			color: #666666;
			line-height: 40rpx;
			font-style: normal;
		}
	}

	.active {
		background-color: rgba(32, 128, 247, 1);

		._name {
			color: #fff;
		}
	}
</style>